package com.face.receive.jsu;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.face.bean.jsu.UsernameAndName;
import com.face.operate.jsu.LostMessage;
import com.face.operate.jsu.LostToken_Operate;


@WebServlet("/UpdateLost")
public class UpdateLost extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		this.doPost(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String id = request.getParameter("id");
		String name = request.getParameter("name");
		String address = request.getParameter("address");
		String age = request.getParameter("age");
		String location = request.getParameter("location");
		String others = request.getParameter("others");
		String phone = request.getParameter("phone");
		String sex = request.getParameter("sex");
		String stature = request.getParameter("stature");
		String time = request.getParameter("time");
		String weight = request.getParameter("weight");
	
		LostMessage lostMessage = new LostMessage();
		UsernameAndName usernameAndName = lostMessage.selectNameById(id);
		LostToken_Operate lost = new LostToken_Operate();
		lost.updateName(name,usernameAndName);
		lostMessage.updateById(id,name,address,age,location,others,phone,sex,stature,time,weight);
	}

}
